import java.sql.Connection;

public abstract class CustomerManager {

	private Connection connection;
	protected PropertyDBManager propertyDBManager;
	protected RankDBManager rankDBManager;

	public CustomerManager(Connection initConnection, PropertyDBManager propertyDBManager, RankDBManager rankDBManager) {
		// constructor - initialiaze connection
		// use this connection in all functions of AccountManager

		setConnection(initConnection);
		setPropertyDBManager(propertyDBManager);
		setRankDBManager(rankDBManager);
	}

	public PropertyDBManager getPropertyDBManager() {
		return propertyDBManager;
	}

	public void setPropertyDBManager(PropertyDBManager propertyDBManager) {
		this.propertyDBManager = propertyDBManager;
	}

	public RankDBManager getRankDBManager() {
		return rankDBManager;
	}

	public void setRankDBManager(RankDBManager rankDBManager) {
		this.rankDBManager = rankDBManager;
	}

	public Connection getConnection() {
		return connection;
	}

	public void setConnection(Connection connection) {
		this.connection = connection;
	}

	public abstract Long addCustomer(Customer newCustomer, double moneyAmount) throws DBManagerException;

	// Add new Customer to customers table
	// function receive Customer object , moneyAmount for get customer rank
	// propertyDBManager for get customer id
	// rankDBManager for get customer rank
	// return custId for new added customer

	public abstract boolean deleteCustomer(Customer oldCustomer) throws DBManagerException;

	// Remove old Customer from customers table
	// receive Customer object
	// return TRUE in case customer was removed successfully
	// return FALSE - problem to remove customer

	public abstract Customer getCustomerById(long custId) throws DBManagerException;

	// Return Customer Object by customerId number
	// in case Object with such customer_id wasn't found
	// Return empty object with appropriate message

	public abstract boolean updateCustomerbyClientAction(Customer currCustomer) throws DBManagerException;

	// Update Customer inforamtion
	// receive Customer Object
	// Update personal inform :email, telephone, address
	// return TRUE in case customer personal inform was updated successfully
	// return FALSE - problem to update personal data

	public abstract boolean updateCustomerbyAdminAction(Customer currCustomer) throws DBManagerException;

	// Update Customer inforamtion
	// receive Customer Object
	// Update rank ( status - platinum/gold/regular ) and comments
	// return TRUE in case customer personal inform was updated successfully
	// return FALSE - problem to update data

	public abstract boolean checkPassword(long currPassword) throws DBManagerException;

	// Check that password not exist in customers table
	// return TRUE in case password exist in table ( with appropriate message )
	// return FALSE - this password not exist in table

	// public void showACustomer(Customer currCustomer) {
	// // print data for current Customer
	// currCustomer.PrintCustomer();
	// }

}
